<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link href="__MODES__/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link href="__MODES__/assets/css/codemirror.css" rel="stylesheet">
		<link rel="stylesheet" href="__MODES__/assets/css/ace.min.css" />
		<link rel="stylesheet" href="__MODES__/font/css/font-awesome.min.css" />
		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="__MODES__/assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="__JS__/jquery-1.9.1.min.js"></script>
		<script src="__MODES__/assets/js/bootstrap.min.js"></script>

		<script src="__MODES__/assets/js/typeahead-bs2.min.js"></script>
		<script src="__MODES__/assets/layer/layer.js" type="text/javascript"></script>
		<script src="__MODES__/assets/laydate/laydate.js" type="text/javascript"></script>
		
		<title>交易金额</title>
		<script  src="__PLUGINS__/layer/layer.js"></script>
	    <script  src="__PLUGINS__/common.js"></script>
	</head>

	<body>
		<div class="margin clearfix">
			<div class="search_style">
				<form action="" method="get">
	      			<ul class="search_content clearfix">
                      	<li><label class="l_f">用户手机号 </label><input name="phone" id="phone" type="text" class="text_add" value="{if isset($getdata['phone'])}{$getdata['phone']}{/if}" placeholder="用户手机号" style=" width:150px"></li>
				 		<li><label class="l_f">订单状态类型</label>
				 			<select name="state" id="state" style=" width:150px">
				 				<option value="">--全部类别--</option>
				 				<option value="0" {if isset($getdata['state']) && $getdata['state']=='0'}selected{/if}>--0未支付--</option>
				 				<option value="1" {if isset($getdata['state']) && $getdata['state']=='1'}selected{/if}>--支付成功--</option>
				 				<option value="2" {if isset($getdata['state']) && $getdata['state']=='2'}selected{/if}>--支付失败--</option>
				 				<option value="3" {if isset($getdata['state']) && $getdata['state']=='3'}selected{/if}>--处理中--</option>
				 				<option value="4" {if isset($getdata['state']) && $getdata['state']=='4'}selected{/if}>--已退款--</option>
				 				<option value="5" {if isset($getdata['state']) && $getdata['state']=='5'}selected{/if}>--免费升级--</option>
				 				<option value="6" {if isset($getdata['state']) && $getdata['state']=='6'}selected{/if}>--关系升级--</option>
				 			</select>
				 		</li>
				    	<li><label class="l_f">订单号</label><input name="form_no" value="{if isset($getdata['form_no'])}{$getdata['form_no']}{/if}" id="form_no" type="text" class="text_add" placeholder="本平台订单号" style=" width:150px"></li>
				    	<li><label class="l_f">上游订单号</label><input name="sn"  value="{if isset($getdata['sn'])}{$getdata['sn']}{/if}" id="sn" type="text" class="text_add" placeholder="上游订单号" style=" width:150px"></li>
				    	<li><label class="l_f">升级类别</label>
				    		<select name="type_id" id="type_id" style=" width:150px">
				 				<option value="">--全部类别--</option>
				 				{volist name='listType' id='lt'}
				 					<option value="{$lt.type_id}" {if isset($getdata['type_id']) && $getdata['type_id']==$lt['type_id']}selected{/if}>{$lt.type_name}</option>
				 				{/volist}
				 			</select>
				    	</li>
				    	<li><label class="l_f">订单时间</label><input name="time" value="{if isset($getdata['time'])}{$getdata['time']}{/if}" class="inline laydate-icon" id="start" style=" margin-left:10px;"></li>
				    	<li style="width:90px;"><button type="submit" class="btn_search"><i class="fa fa-search"></i>查询</button></li>
			    	</ul>
		    	</form>
		    </div>

			<div class="amounts_style">
				
				<div class="transaction_Money clearfix">
					<div class="Money"><span>成交总额：{$count.sum}(利润：{$count.profit})元</span>
						<p>统计每访问期1个小时更新一次</p>
					</div>
					<div class="Money"><span><em>￥</em>{$count.today}元</span>
						<p>当天成交额</p>
					</div>
				</div>
				
				<div class="border clearfix">
					<span class="l_f">
			    		<a href="{:Url('Admin/Upgrade/index')}" class="btn btn-info">全部订单</a>
			    		<a href="javascript:;" onclick="upgrade();" class="btn btn-danger">当天订单</a>
			       </span>
					<span class="r_f">共：<b>{$count.count}</b>笔</span>
				</div>
				<div class="Record_list">
					<table class="table table-striped table-bordered table-hover" >
						<thead>
							<tr>
								<th >用户表ID</th>
								<th>支付渠道</th>
								<th>订单号</th>
								<th>上游订单号</th>
								<th>金额</th>
								<th>升级类别</th>
								<th>支付状态</th>
								<th>发起时间</th>
								<th>完成时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{volist name='list' id='v'}
							<tr>
								<td>{$v.upgrade_uid|getUser='user_account'}</td>
								<td>{$v.upgrade_pay_id|getPayment='payment_name'}</td>
								<td>{$v.upgrade_form_no}</td>
								<td>{$v.upgrade_sn}</td>
								<td>{$v.upgrade_money}</td>
								<td>{$v.upgrade_type_id|getUserType}</td>
								<td>
								{switch v.upgrade_state}
								    {case 1}支付成功{/case}
								    {case 2}支付失败{/case}
								    {case 3}处理中{/case}
								    {case 4}已退款{/case}
								    {case 5}免费升级{/case}
								    {case 6}关系升级{/case}
								    {default /}未支付
								{/switch}
								</td>
								<td>{$v.upgrade_time|date='Y-m-d H:i:s'}</td>
								<td>{$v.upgrade_oktime|date='Y-m-d H:i:s'}</td>
								<td>
									{if $v['upgrade_state']==0}
										<a title="补单" href="javascript:;"  data-url="{:Url('Admin/Upgrade/supply')}?id={$v['upgrade_id']}" data-confirm="您确定要把此订单修改为成功<br/>并修改状态吗？"  class="link-confirm btn btn-xs btn-info Refund_detailed">补单</a>
									{/if}
									<a title="删除" href="javascript:;"  data-url="{:Url('Admin/Upgrade/delete')}?id={$v['upgrade_id']}" data-confirm="确定删除吗？数据不可逆的"  class="link-confirm btn btn-xs btn-danger">删除</a>
								</td>
							</tr>
							{/volist}
						</tbody>
					</table>
					<div>
		                {$list->render()|raw}
		            </div>
				</div>
			</div>
		</div>
		
	</body>

</html>
<script>
	$(function() {
		
		$('table th input:checkbox').on('click', function() {
			var that = this;
			$(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function() {
					this.checked = that.checked;
					$(this).closest('tr').toggleClass('selected');
				});

		});
		
		laydate({
		    elem: '#start',
		    event: 'focus' 
		});
		
		
	})
	
	function upgrade () {
		parent.layer.open({
			type: 2,
			title: false,
			closeBtn: 1,
			area: ['700px', '600px'],
			shadeClose: true,
			skin: 'yourclass',
			content: '{:Url('Admin/Upgrade/upgrade')}',
			
		});
	}
</script>